package com.adee.gulimall.product.feign;

import com.adee.gulimall.util.utils.R;
import com.adee.gulimall.product.feign.fallback.WareFallbackFeignService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

// 远程服务熔断降级时就会调用fallback指定的兜底方法
@FeignClient(value = "gulimall-ware", fallback = WareFallbackFeignService.class)
public interface WareFeignService {
    /**
     * 查询sku库存
     */
    @GetMapping("/ware/waresku/stock/{skuId}")
    R<Integer> skuStock(@PathVariable("skuId") Long skuId);
}
